UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '67Wv2VsXYlBc08lmjy7XIQ2o5pg2R1yF1pyfNeaZi9k='
WHERE
key_id = 'b7f1ed2c2d82ed4d2fa9a19ae92f9fcf3d2b91d2e45e214b9f035b3d7c7809e4'
AND (
token = '67Wv2VsXYlBc08lmjy7XIQ2o5pg2R1yF1pyfNeaZi9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)