UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6tzvaIgzcFGPsyoS96L8xPlM7ei+rmpVXC4R62AvgWA='
WHERE
key_id = '76a2e65fbd11e7ebb17dd1af6a0c0e93f7c8a176a3031892b4db7f1f86e6571e'
AND (
token = '6tzvaIgzcFGPsyoS96L8xPlM7ei+rmpVXC4R62AvgWA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)