UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VXHaLKVU1V/HVatqiuUVYjRWN9O7BaoyoqdQH59TWJc='
WHERE
key_id = '9bc764702f2e25a7077677efe2ec6c0cf8b18f7817ba9c926f3df3eabc3ce0e2'
AND (
token = 'VXHaLKVU1V/HVatqiuUVYjRWN9O7BaoyoqdQH59TWJc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)