UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PUv2Q77NB1uiVOHiKchbGuyEgMmx1f8Q+AIymvFI9s0='
WHERE
key_id = '65f64bcfffa0c3e749ca86f2ab87c97c228b7e959c92611aa53cdb1f6a3e5f1e'
AND (
token = 'PUv2Q77NB1uiVOHiKchbGuyEgMmx1f8Q+AIymvFI9s0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)