UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IsOTON0ljn8YgC0QfZgzuV0NvrvkSwB/CXvWRTwvhpc=' 
WHERE 
  key_id = '7a80abc89ee148571a451b67ebc1e77cf8741eff6ccec794b29e880ff4ff7d77' 
  AND (
    token = 'IsOTON0ljn8YgC0QfZgzuV0NvrvkSwB/CXvWRTwvhpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039