UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9yetJNkukepfxQd1c2yqRAh3fmWH99byPTJDXFhdXOc='
WHERE
key_id = '9292ee68e88d3bf5716d28904b7ba30f7a16503710c362098e5b846c7737443a'
AND (
token = '9yetJNkukepfxQd1c2yqRAh3fmWH99byPTJDXFhdXOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)