UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ETtrbaWyluDYRGvnRDHBrthhBo+u9Ss9h1CakUDKASo='
WHERE
key_id = '349cf80582c2a04bf9aaa30db163c1a4f4c3da29cb21ded99a037852c449dbd0'
AND (
token = 'ETtrbaWyluDYRGvnRDHBrthhBo+u9Ss9h1CakUDKASo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)