UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UiD3cHqaZL/dzbMVpq1B4Y+oArYRP5wHbLn3VW6IqlY=' 
WHERE 
  key_id = '3a2d099dd9653e8d5bcc198aa46e2c76f954fd31f9f5f9f16976d4e89928de71' 
  AND (
    token = 'UiD3cHqaZL/dzbMVpq1B4Y+oArYRP5wHbLn3VW6IqlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038