UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0uQGs8/XjtH6Y94+KxaOxCECOuQWqYFkJis8PGLcyJQ='
WHERE
key_id = 'da5a79dc681003fe61028b20df6f9a0a934fbbabc3338a1fe3b7c0289a333552'
AND (
token = '0uQGs8/XjtH6Y94+KxaOxCECOuQWqYFkJis8PGLcyJQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)