UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Cmq8MpSdmGYbi2LNJpuWD6iWQUpsXq2xIh7Kt8l+KM=' 
WHERE 
  key_id = '7cf607c574bcf381aa1481c937ad2899fb8be443e52bfb0691adc9ff5521a212' 
  AND (
    token = '4Cmq8MpSdmGYbi2LNJpuWD6iWQUpsXq2xIh7Kt8l+KM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029