UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sOwexW8m8c78TKBmqLbvlz8TzmTb5kfp6Qm+kNYYdao=' 
WHERE 
  key_id = '34049e9cff9f7b0d648261ce70e6c899fa638177b079f274c2ab270f73d83eff' 
  AND (
    token = 'sOwexW8m8c78TKBmqLbvlz8TzmTb5kfp6Qm+kNYYdao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030