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

Query time 0.00068