UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3+kyHBhOFmUJQ55gcOG8yiQEvnzzYxASAC/2MsDXjRg='
WHERE
key_id = '332b287367ddbcfbe43e1309d6c068615b9cc0a48b96048db265649a8ab3f876'
AND (
token = '3+kyHBhOFmUJQ55gcOG8yiQEvnzzYxASAC/2MsDXjRg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)