UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qm+e9isFWXHbOyHNi4ADyqUu82T+gsK1Vy2xxLXQJQc=' 
WHERE 
  key_id = 'f3f43c3c96d2e1d7aa028c7a7d5c0c94393a4f9585ec2e5f445c8c4b913f8134' 
  AND (
    token = 'Qm+e9isFWXHbOyHNi4ADyqUu82T+gsK1Vy2xxLXQJQc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024