UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0VQf0cO0QjEkeRqIarMaf5wMgY3F3mJI3feiiy9TeL8='
WHERE
key_id = 'd48232fead4d76d4b86d6261f4b51b0a9583dfddbcee6ef28203eb7b753959f4'
AND (
token = '0VQf0cO0QjEkeRqIarMaf5wMgY3F3mJI3feiiy9TeL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)