UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G9KUE0oQTcjaxHWjC8NvDM57bnwBLM8hOVeQ+dFgG6g='
WHERE
key_id = '74dd5e97280a8e4023d7be2525e776469a9372fab0a0e585055c772826cded35'
AND (
token = 'G9KUE0oQTcjaxHWjC8NvDM57bnwBLM8hOVeQ+dFgG6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)