UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xUwF+lcq10qow2S0rAwv2vuZa0AMwepANlHxztLgOeA=' 
WHERE 
  key_id = 'e73da8ea230ac253b49f4935c4ab571346a09147db1ffc5c5fe71d9241715ca0' 
  AND (
    token = 'xUwF+lcq10qow2S0rAwv2vuZa0AMwepANlHxztLgOeA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041