UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Pm5IPEs2COfJLHXnna0o/KdzIvu926S+5BS7IpK+LY=' 
WHERE 
  key_id = '2243f22e204ed8062ab33156f155ef26c8063e21abfa091b53ea31fa24bcb109' 
  AND (
    token = '7Pm5IPEs2COfJLHXnna0o/KdzIvu926S+5BS7IpK+LY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039