UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w2wZ7C4bLx9J7uVr7Nk45QeVXHInyblZOAn2oPneBuM='
WHERE
key_id = '44828fbf8a6c92df3862e66ef645332d7d6b584177048dd2207b4a44f1bdcd3b'
AND (
token = 'w2wZ7C4bLx9J7uVr7Nk45QeVXHInyblZOAn2oPneBuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)