UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QFSZcQ/cEj8g7rBLEqTeePRy2FUYd/AnGXXTsnkB7kY=' 
WHERE 
  key_id = '3f788120492dbfa9e7131df0f6ddd517b27c7d690ac5068234e553c2f9c0210d' 
  AND (
    token = 'QFSZcQ/cEj8g7rBLEqTeePRy2FUYd/AnGXXTsnkB7kY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018