UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FkGZt7P3ZiMz37+4oTQfk/oiSdQnkX2jw7V4k46493c='
WHERE
key_id = 'a9562919595479f121d09374e4455ff608bb05a0d660ed0783c5f540db067dfa'
AND (
token = 'FkGZt7P3ZiMz37+4oTQfk/oiSdQnkX2jw7V4k46493c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)