UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZuGQhYX3ei7lLefXWrFnsVJdF3mTkjZL9IMeKvvRnkc=' 
WHERE 
  key_id = '36409e14ecc7f073a98b13f97231a9f241ede72af6dea0190872efdedd5a1ad4' 
  AND (
    token = 'ZuGQhYX3ei7lLefXWrFnsVJdF3mTkjZL9IMeKvvRnkc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058