UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KAmpf/3LPDJ60RGAUR1wvM9qPFT7QJVIkEhvJWV9sMY='
WHERE
key_id = 'dc0d02d17c570e71ca627b0c7c04c4cba47c8e0e9076f003fbdd6256d5021754'
AND (
token = 'KAmpf/3LPDJ60RGAUR1wvM9qPFT7QJVIkEhvJWV9sMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)