UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vvntEV2/5n3vdvFKTkSHiSK7WnDhIvWu/haScL4GMUg='
WHERE
key_id = '4a739340f8c9553fda9e66c4d5704a02593a5f7b6f5928a18a79e2604d888d92'
AND (
token = 'vvntEV2/5n3vdvFKTkSHiSK7WnDhIvWu/haScL4GMUg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)