UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '45Eb4FGEpk5fm/MVganTzBSOe+EEs8+byeT5S2znGV4=' 
WHERE 
  key_id = 'fd5a0ba88c4d0e820a3cc0cae04fd5d48e7080bbd26e32a49ebd462532521346' 
  AND (
    token = '45Eb4FGEpk5fm/MVganTzBSOe+EEs8+byeT5S2znGV4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020