UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5G8TM3rQgddhJYb+Y0f0eE5kWGdudFfrNbrMXQXuovw=' 
WHERE 
  key_id = '5acf2c0ca6e94a99ec6b44aa6f3a45734c3f6679ddd61c5e6c131421a60d175d' 
  AND (
    token = '5G8TM3rQgddhJYb+Y0f0eE5kWGdudFfrNbrMXQXuovw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044