UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/7XwgOu3d80BOPrtY3WzaeO4OJFIO2/XsLTcMzNUgUg=' 
WHERE 
  key_id = '248853be1965fb5cf8c8781c493331b267dd2d942768228ca21cb50032e7c26b' 
  AND (
    token = '/7XwgOu3d80BOPrtY3WzaeO4OJFIO2/XsLTcMzNUgUg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030