UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UD2BEKn8D1WaoQ8NJ6WnOxxUufuysXrWsFAZ55GeKXI=' 
WHERE 
  key_id = 'fe14bf0431c6e05c920e824a7f34e37d18db2555c0a7649d662788ca5587768b' 
  AND (
    token = 'UD2BEKn8D1WaoQ8NJ6WnOxxUufuysXrWsFAZ55GeKXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027