UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M82IkVAuGhxHh1uzNFPcAxBWrdbqu/9wMWVMAfcj7e0='
WHERE
key_id = 'f6eb365ad8d04a7c9860642504500f17de561a64eb76e75dfe7a9e44af5fc384'
AND (
token = 'M82IkVAuGhxHh1uzNFPcAxBWrdbqu/9wMWVMAfcj7e0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)