UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IHuSjTFr0BJx1LSkhhxyuFoOuED23ZuyaL3xdFilvLw='
WHERE
key_id = '49fcf90c7186909b855211c1d12c37c2f3e0d2bbc39828ab4f48596997a2be9f'
AND (
token = 'IHuSjTFr0BJx1LSkhhxyuFoOuED23ZuyaL3xdFilvLw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)