UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hYN3mTmctdwHMZ88S6lktkH/8040f2yguzdyxpBNvNY=' 
WHERE 
  key_id = 'fda7a074dde625be5c64b58cabab62063494fd5f88f9a7c97618543bace48b24' 
  AND (
    token = 'hYN3mTmctdwHMZ88S6lktkH/8040f2yguzdyxpBNvNY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028