UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ue0oG+Y/+t339J6WVhZs9RJ4rwUYUvjzu1ovpViSKH8=' 
WHERE 
  key_id = '06f1be82ec902ce7bcbc1f0d54dfc7693cc8fec70d0016fc1bd0d90941775686' 
  AND (
    token = 'Ue0oG+Y/+t339J6WVhZs9RJ4rwUYUvjzu1ovpViSKH8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033