UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '17QbypGbBTFfQ0euMF3SutzVSf1zgAZB7dHkSVTbWeI='
WHERE
key_id = '2db73d54f44326e669923ed9f795678195ca9ec01f2560b00c6bb56a91299d5d'
AND (
token = '17QbypGbBTFfQ0euMF3SutzVSf1zgAZB7dHkSVTbWeI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)