UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LhMXkExeMdAu6rZxYfPyukuBbA/WPprAQPakBbQZ1r8=' 
WHERE 
  key_id = 'bc21e897726ede5b63898ee68d5ff97810eea37f1e597fca6ad7fd626e7702be' 
  AND (
    token = 'LhMXkExeMdAu6rZxYfPyukuBbA/WPprAQPakBbQZ1r8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049