UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4CAfXZosXtoNOo3lt8BN1/B/rwpAjVTnL8tn5OhhrCc='
WHERE
key_id = '5c8b84441e6ce9b62d44d84e2fe5028dddaf4a2d0e30badb07c264f48c68222c'
AND (
token = '4CAfXZosXtoNOo3lt8BN1/B/rwpAjVTnL8tn5OhhrCc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)