UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UyXCdfdHNx4Hp5Un+4sWouM49jYlPj0RP0diA39HHUs=' 
WHERE 
  key_id = '70b9ead261114fefb0e3933ce026e8ce25e9da0ecacc728589c02de46d7f12d8' 
  AND (
    token = 'UyXCdfdHNx4Hp5Un+4sWouM49jYlPj0RP0diA39HHUs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040