UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mq0LBLKoALqqjq2iu3AxyO8KGDbIs5og6XIzubKlr6Y='
WHERE
key_id = '17195351415714c0fa61fb8ab4cf568edef7d05691829ab75b88daada7619582'
AND (
token = 'mq0LBLKoALqqjq2iu3AxyO8KGDbIs5og6XIzubKlr6Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)