UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xd7v5v3+sfDi5LPKeM4GYYsjTWVN5wFirJqh1H7g5Ho='
WHERE
key_id = '9bbeb854d1568417ca41e43dd85aacb1f2a15fcf26a9f9b15da051731396b406'
AND (
token = 'xd7v5v3+sfDi5LPKeM4GYYsjTWVN5wFirJqh1H7g5Ho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)