UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's6bo8yaayVPc3I89za94UMG17GHW1CR9LWGZGe1YWHY='
WHERE
key_id = '80cbadff894393ea1e1ad88490348f75f81ef3c6b68dea512ee3c17a9e37fb10'
AND (
token = 's6bo8yaayVPc3I89za94UMG17GHW1CR9LWGZGe1YWHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)