UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D9kgh+YbZGL/k9K4n6sru7tDPSDSjCNmbM/Jf8Bbiu4='
WHERE
key_id = '9d6187041733a3c0176bdccac05b0f574f9db1a8fe5f51650c37c1dd4fdf3676'
AND (
token = 'D9kgh+YbZGL/k9K4n6sru7tDPSDSjCNmbM/Jf8Bbiu4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)