UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v7NsFyr9YOdr/+HhgviN/w+LWc4m8/Npc0k/hIBKIOI=' 
WHERE 
  key_id = '1feb4f859e38dcd98708068b7c28e0fb73e77d913559d9ae1678e2febd58ca7c' 
  AND (
    token = 'v7NsFyr9YOdr/+HhgviN/w+LWc4m8/Npc0k/hIBKIOI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035