UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sabr5Hc6taKaUIC3Dax31Bj8JWwvwn5+bx2Bpk9gPX4='
WHERE
key_id = '089dbd247dd1a733b4ca11621d0378e0cfcf2b0921044c1616771138d1de9484'
AND (
token = 'sabr5Hc6taKaUIC3Dax31Bj8JWwvwn5+bx2Bpk9gPX4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)