UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z1nicklzyrOKviwZMqMS7BHGm+Pm708scc9r7fpEB4U='
WHERE
key_id = 'a8ffc4c9c7b496a9523c65b9329cd6f5560799678055ae2063c094d41c40220b'
AND (
token = 'Z1nicklzyrOKviwZMqMS7BHGm+Pm708scc9r7fpEB4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)