UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'skddlRysFB6HF4PwKkWmMcmKhXZ6t1k6yRouWIivaDQ='
WHERE
key_id = '399b01af5a5cfdf290ee458cffc8235712d25ca5beff97c34b51d321c62c3e2d'
AND (
token = 'skddlRysFB6HF4PwKkWmMcmKhXZ6t1k6yRouWIivaDQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)