UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i/V0eEDZNkOGzTj7fK+nRbwLJVJweXM1lxzfue51zXg=' 
WHERE 
  key_id = '809e8b3462d267eae94183f6f1d06c1ffdf29b8286e1d4679c168381a8bccfc5' 
  AND (
    token = 'i/V0eEDZNkOGzTj7fK+nRbwLJVJweXM1lxzfue51zXg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062