UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2sim+yCZPND7RabyG+qLaoSRjMML02Ziy93cx4bTAPM='
WHERE
key_id = 'c2667ad609c9d38d1a6556fc10bbd8ec4da361754f946b3db55d16f92aaf1a49'
AND (
token = '2sim+yCZPND7RabyG+qLaoSRjMML02Ziy93cx4bTAPM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)