UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M7GVeaP1+mAW3A2Sf13FQSR7ALFevhaQ+hbJ/RURejs=' 
WHERE 
  key_id = 'b476b114a0e00287154bd3e3d026bae1c08ed0020c169e6b6598b8def687fb29' 
  AND (
    token = 'M7GVeaP1+mAW3A2Sf13FQSR7ALFevhaQ+hbJ/RURejs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036