UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hf9KwPHFeScb1gnQ+jW9m8tlGjU1SeJBtikcyc5OWRQ=' 
WHERE 
  key_id = 'b91aa974c2109fd8e7be2b3869f33c8ae9f40ecc1826f7c7afe3e421e36ebbf3' 
  AND (
    token = 'hf9KwPHFeScb1gnQ+jW9m8tlGjU1SeJBtikcyc5OWRQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021