UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DmZ7fTPMVhFVhcYfow/LBsmWmjsf4EVBwBcNx0JBqlU=' 
WHERE 
  key_id = '82dbb695a00c4aa48e0debdb63116a9e35fac163b780576fb87aeff961665ef5' 
  AND (
    token = 'DmZ7fTPMVhFVhcYfow/LBsmWmjsf4EVBwBcNx0JBqlU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020