UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eeMOnVtiz3LsdQC8W0am5hIMSqt9c1Vlw10hc6XjrxA=' 
WHERE 
  key_id = '0cdd27382d712cdc924d1009946b5d725d838c5608eb085f1c56bcd8247175ae' 
  AND (
    token = 'eeMOnVtiz3LsdQC8W0am5hIMSqt9c1Vlw10hc6XjrxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042