UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zbyQ0v6LYF1iwsjILEp1HAq0iEBEcRWJ984WVY8p24Y=' 
WHERE 
  key_id = 'ab62f7d5afd2d94d9ce623e6d41eee1d5291d5cc0a6abddeefde2676de52a46e' 
  AND (
    token = 'zbyQ0v6LYF1iwsjILEp1HAq0iEBEcRWJ984WVY8p24Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041