UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'THOjKUSwQUdl2bzsEYFiHsnyk8VAaQ6+F06AbCj0zFk=' 
WHERE 
  key_id = 'db4dea7d384dead6dc2fffa0f95c0665ff25e5d0b2bbae8f9b9997e111308908' 
  AND (
    token = 'THOjKUSwQUdl2bzsEYFiHsnyk8VAaQ6+F06AbCj0zFk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039