UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YnD3/jcqXxL5ZvqlFRdQpTwzOWagw6uD0sbFlwSwNEc='
WHERE
key_id = '7a1179999d260bfbe421c0a924166e1f93bbcc1af98a809829908dcdf209c223'
AND (
token = 'YnD3/jcqXxL5ZvqlFRdQpTwzOWagw6uD0sbFlwSwNEc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)