UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0txNb2SC34x1M5msUZnxfqtxI26CkRKQl4IEXFAtr78='
WHERE
key_id = '9962a5315a108611dde2a9e20edcf96d36fb5a66a0058912e2cc84ed2eaa0ded'
AND (
token = '0txNb2SC34x1M5msUZnxfqtxI26CkRKQl4IEXFAtr78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)