UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WGUbzxET5nsauTcM55M3rxcA3f0RK6OkgyrwZp/cMac='
WHERE
key_id = '2be2f1c7721fc7f17a87d6059f757c9975bc12e13b325fe6eb5a71ef30c8dedc'
AND (
token = 'WGUbzxET5nsauTcM55M3rxcA3f0RK6OkgyrwZp/cMac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)