UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '44GR79VjpCzEzZHrf2SeGucPi0QGikRqW9xzZCEjKRs='
WHERE
key_id = '6afc9aaf9e5a9782b972b6896b85818ab80f78b141301726852c29fe536519eb'
AND (
token = '44GR79VjpCzEzZHrf2SeGucPi0QGikRqW9xzZCEjKRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)