UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MHXcxmCiHPWO/0d6srKMicWttvSaAATsVp/Ksr+uVfs=' 
WHERE 
  key_id = 'dc6ecd7101e7cde4ac1975cf7170947cf3acbb9f1a0f555286bdb6b16d666f9c' 
  AND (
    token = 'MHXcxmCiHPWO/0d6srKMicWttvSaAATsVp/Ksr+uVfs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026