UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9u7wtkCFj3snTPh9uI+75Ujs315TvB3lmLDN2y5Ltl8='
WHERE
key_id = 'f4abcbae50ff41f93702483a687dbde440ee7b784bf05a0854d10d08062fdebc'
AND (
token = '9u7wtkCFj3snTPh9uI+75Ujs315TvB3lmLDN2y5Ltl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)