UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5+EuPdRV46IslI5+wAi44qlHjYyCfQyjGi5gw0b1dUk='
WHERE
key_id = '3ec36aefcadd584fc7a43b876ed1e9b15f6cc1e0e93b094b396698e85265820b'
AND (
token = '5+EuPdRV46IslI5+wAi44qlHjYyCfQyjGi5gw0b1dUk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)