UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'exBLdUByiQ5Mtb/NyB8BP9mx8w/rTDGpSE9U6qiqkZo=' 
WHERE 
  key_id = '73f24dac5b45e4a95215a6989e3db854cfed15c175e68de14c59a95656f4116c' 
  AND (
    token = 'exBLdUByiQ5Mtb/NyB8BP9mx8w/rTDGpSE9U6qiqkZo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038