UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EgGIcHSsDVAhqNjIisEeEkKQSTZmlai5Q+VD5LghmwM='
WHERE
key_id = 'b7c44c626ec9a1575ca7c952462f75aed5e8ea4412c06a1e4b521f20ad708120'
AND (
token = 'EgGIcHSsDVAhqNjIisEeEkKQSTZmlai5Q+VD5LghmwM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)