UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's5cpjYtMLFEGEcgcsiEuoBh+ptXNpeD03Pr98vNwOEQ=' 
WHERE 
  key_id = 'b380ae66d5195a652ab5ed7950e4827a299b89b592d8ba56f194ca4c2be8b042' 
  AND (
    token = 's5cpjYtMLFEGEcgcsiEuoBh+ptXNpeD03Pr98vNwOEQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038